---
title: Google Search
---

**GoogleSearch** enables an Agent to perform web crawling and scraping tasks.

## Prerequisites

The following examples requires the `googlesearch` and `pycountry` libraries.

```shell
pip install -U googlesearch-python pycountry
```

## Example

The following agent will search Google for the latest news about "Mistral AI":

```python cookbook/tools/googlesearch_tools.py
from agno.agent import Agent
from agno.tools.googlesearch import GoogleSearchTools

agent = Agent(
    tools=[GoogleSearchTools()],
    description="You are a news agent that helps users find the latest news.",
    instructions=[
        "Given a topic by the user, respond with 4 latest news items about that topic.",
        "Search for 10 news items and select the top 4 unique items.",
        "Search in English and in French.",
    ],
        debug_mode=True,
)

agent.print_response("Mistral AI", markdown=True)
```

## Toolkit Params

| Parameter               | Type   | Default | Description                                         |
| ----------------------- | ------ | ------- | --------------------------------------------------- |
| `fixed_max_results`     | `int`  | `None`  | Optional fixed maximum number of results to return  |
| `fixed_language`        | `str`  | `None`  | Optional fixed language for the requests            |
| `headers`               | `Any`  | `None`  | Optional headers to include in the requests         |
| `proxy`                 | `str`  | `None`  | Optional proxy to be used for the requests          |
| `timeout`               | `int`  | `10`    | Timeout for the requests in seconds                 |
| `enable_google_search`  | `bool` | `True`  | Enables Google search functionality                  |
| `all`                   | `bool` | `False` | Enables all functionality when set to True          |

## Toolkit Functions

| Function        | Description                                                                                                                                                                                                                                                                            |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `google_search` | Searches Google for a specified query. Parameters include `query` for the search term, `max_results` for the maximum number of results (default is 5), and `language` for the language of the search results (default is "en"). Returns the search results as a JSON formatted string. |

## Developer Resources

- View [Tools](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/tools/googlesearch.py)
- View [Cookbook](https://github.com/agno-agi/agno/tree/main/cookbook/tools/googlesearch_tools.py)
